package pers.crayon.baseprogram.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 实体类超类，
 *
 * @author roamay.com
 * @since 2021/4/13 0:06
 */
@ApiModel("基础实体类")
public class BaseEntity implements Serializable {

    @ApiModelProperty(value = "标识")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @JsonIgnore
    //@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间", hidden = true)
    private LocalDateTime createTime;

    @JsonIgnore
    @ApiModelProperty(value = "更新时间", hidden = true)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableLogic
    @JsonIgnore
    @ApiModelProperty(value = "删除标志", hidden = true)
    @TableField(fill = FieldFill.INSERT)
    private Boolean delFlag;
}
